package com.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.util.ZookeeperClient;

public class ZookeeperServletContextListener implements ServletContextListener{

	@Override
	public void contextInitialized(ServletContextEvent sce) {

		ServletContext sc = sce.getServletContext();
//		sc.getServletContextName();
//		sc.getRealPath("ip");
//		System.out.println(sc.getServerInfo());
		ZookeeperClient.serverName = sc.getServletContextName();
//		ZookeeperClient.init();
		
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		// TODO Auto-generated method stub
		
	}

}
